import javax.swing.*;    // Needed for JFrame
import java.awt.*;		 // Needed for Graphics

public class polygon extends JFrame
{
    public static void main(String[] args) {
		new polygon();
    }
	
    public polygon()		// Constructor
    {
		this.setSize(800,800);
        this.setVisible(true);
    }

    public void paint(Graphics gfx) {
		int x[] = {20, 20, 500, 500, 400, 300};
		int y[] = {500, 30, 30, 500, 400, 200};
		gfx.drawPolygon(x, y ,6);
    }
}
